home *** CD-ROM | disk | FTP | other *** search
- /**
- GRAB Graph Layout and Browser System
-
- Copyright (c) 1989, Tera Computer Company
- **/
-
- //
- // header file for controlling the 'graph attributes' window
- // and the user-defined attributes display
- //
-
- #ifndef aview_h
- #define aview_h
-
- #include <InterViews/defs.h>
- #include <InterViews/box.h>
- #include <InterViews/button.h>
- #include <InterViews/event.h>
- #include <InterViews/scene.h>
- #include "mymenu.h"
- #include "bview.h"
-
- class VBox;
- class HBox;
- class Interactor;
- class Scene;
- class Frame;
- class PressButton;
-
- class AView : public MonoScene
- {
- public:
- AView(Interactor*, Interactor*);
- void SetAttrNames(char**, char**, int, int); // get things rolling
- boolean SetDisplayed(); // display the attributes window
- void ShowNAttr(char**); // display these node attributes
- void ShowEAttr(char**); // display these edge attributes
- void EraseAttrBox(); // erase the display
- void ChangeAttr(int); // interface for AttrTextItems
- void SetClear(int); // interface for PressButtons
- void Handle(Event&);
- private:
- Interactor* underlying; // we'll insert ourselves into its parent
- Interactor* aligner; // and we'll line it up with this one
- char** node_attr_names;
- char** edge_attr_names;
- int num_node_attr;
- int num_edge_attr;
- boolean* node_attr_displayed;
- boolean* edge_attr_displayed;
- VBox* NAttrMenu;
- VBox* EAttrMenu;
- HBox* NMenuBox;
- HBox* EMenuBox;
- MonoScene* currshow; // the current user-defined attributes display
- Frame* Displayer; // what is displayed in the 'graph attributes' window
- PressButton* eb; // 'close'
- PressButton* nc; // 'node clear'
- PressButton* ec; // 'edge clear'
- PressButton* ns; // 'node setall'
- PressButton* es; // 'edge setall'
- boolean onscreen; // is the window onscreen?
- boolean neveron; // has it ever been onscreen
- Coord oldx, oldy; // where it was last
-
- void PopUp(Scene*, Coord, Coord, Alignment);
- void Disappear(Scene*);
- void DoExit();
- void DoNodeSetall();
- void DoEdgeSetall();
- void DoNodeClear();
- void DoEdgeClear();
- void DisplayNAttrMenu();
- void DisplayEAttrMenu();
- VBox* NewNodeMenu();
- VBox* NewEdgeMenu();
- void InsertNodeMenuItems(VBox*);
- void InsertEdgeMenuItems(VBox*);
- };
-
- // text items in the 'graph attributes' window
- class AttrTextItem : public TextItem
- {
- public:
- AttrTextItem(char*, int, AView*);
- void Handle(Event&);
- private:
- AView* handler;
- int value; // tag so we can tell them apart
- };
-
- // buttons in the 'graph attributes' window
- class PressButton : public PushButton
- {
- public:
- PressButton(char*, ButtonState*, int, AView*);
- void Handle(Event&);
- private:
- AView* handler;
- int value; // tag so we can tell them apart
- };
-
- #endif
-